﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Storage;
using UserInterface;

namespace Factory
{
    public class TastiesFactory
    {
        public static Present CreatePresent()
        {
            Present present = new Present();
            return present;
        }
        public static object CreateTasty(int type, int w)
        {
            Object tasty = null;
            switch (type)
            {
                case 0:
                    Chocolate_sweets chs = new Chocolate_sweets();
                    chs.set_weight(w);
                    tasty=chs;
                    break;
                case 1:
                    Jujube juj = new Jujube();
                    juj.set_weight(w);
                    tasty=juj;
                    break;
                case 2:
                    Caramel car = new Caramel();
                    car.set_weight(w);
                    tasty=car;
                    break;
                case 3:
                    White wh = new White();
                    wh.set_weight(w);
                    tasty=wh;
                    break;
                case 4:
                    Dark d = new Dark();
                    d.set_weight(w);
                    tasty=d;
                    break;
                case 5:
                    Waffle waf = new Waffle();
                    waf.set_weight(w);
                    tasty=waf;
                    break;
                case 6:
                    Cookie co = new Cookie();
                    co.set_weight(w);
                    tasty=co;
                    break;
            }
            return tasty;
        }
    }
    public class FileLoggerFactory
    {
        public static FileLogger CreateLogger()
        {
            FileLogger ilog = new FileLogger();
            return ilog;
        }
    }
    public class ConsoleLoggerFactory
    {
        public static ConsoleLogger CreateLogger()
        {
            ConsoleLogger ilog = new ConsoleLogger();
            return ilog;
        }
    }
}
